package com.youbug.system.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.youbug.common.vo.QueryVo;
import com.youbug.common.vo.R;
import com.youbug.system.entity.SysLog;
import com.youbug.system.service.SysLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

@RestController
@RequestMapping("/sysLog")
public class SysLogController {

    @Autowired
    private SysLogService sysLogService;

    @PostMapping("/page")
    public R<IPage<SysLog> > getSysLogPage(@Valid @RequestBody QueryVo<SysLog> sysLogQueryVo){

        IPage<SysLog> sysLogs = sysLogService.getSysLogs(sysLogQueryVo);

        return R.ok(sysLogs);
    }
}
